﻿using Ensemble_Windows.UI;
using System.Drawing;

namespace Ensemble_Windows
{
    /// <summary>
    /// Panel帮助类
    /// </summary>
    public class PanelHelper
    {
        /// <summary>
        /// 创建Panel
        /// </summary>
        /// <returns>Panel</returns>
        public static Panel Create()
        {
            return new Panel();
        }

        /// <summary>
        /// 创建Panel
        /// </summary>
        /// <param name="width">宽度</param>
        /// <param name="height">高度</param>
        /// <param name="location">位置</param>
        /// <param name="_form">Form窗体</param>
        /// <returns>Panel</returns>
        public static Panel Create(int width, int height,Point location, System.Windows.Forms.Form _form)
        {
            Panel panel = new Panel()
            {
                Width = width,
                Height = height,
                Location = location,
            };
            _form.Controls.Add(panel);
            return panel;
        }

        /// <summary>
        /// 创建Panel
        /// </summary>
        /// <param name="width">宽度</param>
        /// <param name="height">高度</param>
        /// <param name="location">位置</param>
        /// <param name="control">Control</param>
        /// <returns>Panel</returns>
        public static Panel Create(int width, int height, Point location, System.Windows.Forms.Control control)
        {
            Panel panel = new Panel()
            {
                Width = width,
                Height = height,
                Location = location,
            };
            control.Controls.Add(panel);
            return panel;
        }
    }
}
